<?php
class pk_user extends BaseModel implements Retrievable {

	var $level;
	var $subnet;
	var $email;
	var $new_email;
	var $username;
	var $password;
	var $salt;
	var $enabled;
	var $verified;
	var $last_login;
	var $last_active;
	var $status;
	var $logins;
	var $timezone;
	var $profile_views;
	var $updated;
	var $blocklist;
	var $photo;
	var $privacy_search;
	var $privacy_profile;
	var $privacy_comments;
	var $referer;
	var $points_allowed;
	var $emailed;
	var $sports;
	
    public function pk_user($values) {
        parent::__construct($values);
    }

    public function validate() {
        $errors = Array();
		return (count($errors) === 0 ? true : $errors);
    }

    public static function get($id, $primaryKey='id') {
        return parent::get($id, __CLASS__, $primaryKey);
    }
    
    public static function getAll($searchArray=Array(), $sortArray=Array(), $limit=0) {
        return parent::getAll($searchArray, $sortArray, __CLASS__, $limit);
    }
    
    public static function isLoggedIn() {
    	return isset($_SESSION['pk_user']);
    }
    
}
?>